export Audio
Exports the audio of a design block as an audio file of the given mime type. A page mixes the audio of all its blocks, a track mixes its children, and an audio block or a block with a video fill exports its own audio. A scene exports its first page. Note: The export happens in a background thread and the Engine instance in the onPreExport lambda is a separate instance. Use it only until the suspending function resumes. Use this lambda to configure the background engine for export. It holds only the buffers that the exported scene uses, so create any other buffer on it here. A later export of a scene without video or audio can reuse that engine with the resources it loaded, so onPreExport runs on every export, and what it changes stays for the next export: settings, role, global scopes, asset sources and event subscriptions. If uriResolver is provided it will be set on the background engine before the exported scene is loaded and once more after onPreExport is invoked (so it takes precedence if onPreExport also sets a resolver).
Return
the exported audio. From Android 9 a buffer of 1 MiB or more is a direct buffer, without a backing array: read it with get, not array.
Parameters
the design block to export.
the mime type of the output audio file: MimeType.AUDIO_WAV, MimeType.AUDIO_MP4 or MimeType.AUDIO_WEBM. Any other mime type throws an EngineException.
the options used for the export of the block.
optional callback that reports on the progress of the export. It informs the receiver of the number of frames rendered, the number of encoded frames, and the total number of frames to encode.
the lambda to configure the engine before export. This lambda is called on a background thread, and the Engine parameter of this lambda is a separate engine instance running in that background thread.
optional async resolution function that accepts both relative and absolute uri and returns an absolute uri. A buffer:// uri that it returns must name a buffer that the exported scene uses, because the background engine holds no other.
Throws
when block is not part of the scene. The export runs on a copy of the scene, so append a block from createAudioFromVideo to the scene before you export it.
Exports the audio of multiple design blocks as audio files of the given mime type, one after the other, with one background engine. Otherwise it works like the exportAudio overload for one block.
Return
the exported audio data for each block, in the same order as the input blocks.
Parameters
the design blocks to export.
the mime type of the output audio files.
the options used for the export of each block.
optional callback that reports on the progress of each export.
the lambda to configure the background engine before export.
optional async resolution function that accepts both relative and absolute uri and returns an absolute uri.
Throws
when a block is not part of the scene.